// 模拟
const map =(array,fn) => {
    let results = [];
    for(let item of array){
        results.push(fn(item))
    }
    return results;
}
// let arr = [1,2,34,4,5]
// arr =map(arr,i=>i*i)
// console.log(arr)
const every =(array,fn)=>{
    let show = true;
    for(let a of array){
        show = fn(a);
        if(!show){
            break;
        }
    }
    return show
}
// let arr = [88,89]
// let  r = every(arr,a=>a>10)
// console.log(r)
 const some = (array ,fn)=>{
     let result = false;
     for(let data of array){
        result = fn(data);
        if(result){
            break;
        }
     }
     return result
 }
 let arr = [1,33,5]
 let a = some(arr,i=>i%2===0)
 console.log(a)